﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.ExportToRTR.Views.ExportToRTRTreeListModel
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using DnProcessSimulateCommands.InterferenceVolumeQuery.Tree;
using System.Collections;


namespace DnProcessSimulateCommands.ExportToRTR.Views;

internal class ExportToRTRTreeListModel : ITreeModel
{
  private IExportToRTRTreeViewItem root { get; set; }

  public ExportToRTRTreeListModel()
  {
    this.root = (IExportToRTRTreeViewItem) new ExportToRTRTreeItem();
  }

  public IEnumerable GetChildren(object parent)
  {
    if (parent == null)
      parent = (object) this.root;
    return (IEnumerable) (parent as IExportToRTRTreeViewItem).Children;
  }

  public bool HasChildren(object parent)
  {
    return parent is IExportToRTRTreeViewItem toRtrTreeViewItem && toRtrTreeViewItem.Children != null && toRtrTreeViewItem.Children.Count > 0;
  }

  public object RootNode => (object) this.root;
}
